<template>
  <div>
    <h1>let arr = [{a:100}, {a: 20}, {a:-10}]求和</h1>
    <h1>数组和是{{ sum }}</h1>
  </div>
</template>

<script>
let arr = [{ a: 100 }, { a: 20 }, { a: -10 }]
export default {
  data () {
    return {
      sum: arr.reduce((pre, curr) => {
        return pre + curr.a
      }, 0),
    }
  },
}
</script>

<style></style>
